import Vue from 'vue'
import VueRouter from 'vue-router'

import a from '../view/a.vue'

import b from '../view/b.vue'
import login from '../view/login.vue'
import reg from '../view/reg.vue'
import regEdit from '../view/regEdit.vue'
import myuser from '../view/myuser.vue'
Vue.use(VueRouter)
const router = new VueRouter({
    routes: [
        {
            path: '/',
            name:'/login',
            redirect: '/login'//路由的默认值设置
        },
        {
            path: '/login',
            name:'/login',
            component: login
        },
        {
            path: '/reg',
            name:'/reg',
            component: reg
        },
        {
            path: '/myuser',
            name:'/myuser',
            component: myuser
        },
        {
            path: '/regEdit',
            name:'/regEdit',
            component: regEdit
        },
        {
            path: '/a',
            name:'/a',
            component: a
        },
        {
            path: '/b',
            name:'/b',
            redirect: '/bnews',//路由的默认值设置
            component: b,
            children:[
                {
                    path:'/bnews',
                    component:()=>import('../view/bnews.vue')
                },
                {
                    path:'/bcontent',
                    component:()=>import('../view/bcontent.vue')
                }
            ]
        }
    ],
    mode:'history'
})
export default router